#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<unistd.h>
#include<signal.h>
#include<cstdlib.h>

void hanlder(int signum)
{
	std::cout << "hello signal: " << signum << std::endl;
	exit(0);
}

int main()
{
	struct signaction act oact;
	act.sa_handler = handler;

	signaction(SIGINT, &act, &oact);

	while (true)
	{
		std::cout << "hello world" << std::endl;
		sleep(1);
	}

	return 0;
}